<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    let a = {
      name: 'jack',
      getName: function (msg) {
        return msg + this.name;
      },
    };
    let b = {
      name: 'lily',
    };
    console.log(a.getName('hello~'));
    console.log(a.getName.call(b, 'hi~'));
    console.log(a.getName.apply(b, ['hi~']));
    let name = a.getName.bind(b, 'hello~');
    console.log(name());
  </script>
</html>
